package com.young.dubbo.healtyconsumer.controller;


import com.alibaba.dubbo.config.annotation.Reference;
import com.young.healty.api.service.DemoService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/demo")
public class DemoController {

    @Reference
    private DemoService demoService;

    /**
     * localhost:18888/api/demo/say/yjx
     *
     * @author yangjunxiong
     * @date 2020/8/20 20:41
     * @param name
     * @return java.lang.String
     **/
    @RequestMapping("/say/{name}")
    public String sayHello(@PathVariable("name") String name) {
        String s = this.demoService.sayHello(name);
        System.out.println("s = " + s);
        return s;
    }
}
